package com.bwie.service.impl;

import com.bwie.dao.BasicDao;
import com.bwie.pojo.BasicUsers;
import com.bwie.service.BasicService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BasicServiceImpl implements BasicService {

    @Autowired
    BasicDao basicDao;
    public PageInfo<BasicUsers> selectList(String userName, Integer pageNum) {
        PageHelper.startPage(pageNum,2);//工具类分页
        List<BasicUsers> listBasic =  basicDao.selectList(userName);
        System.out.println(listBasic);
        return new PageInfo<BasicUsers>(listBasic);
    }

    public BasicUsers updateInfo(Integer usersId) {
        BasicUsers basicUsers =  basicDao.updateInfo(usersId);
        return basicUsers;
    }

    public Integer updateBasic(BasicUsers basicUsers) {
       Integer aa =  basicDao.update(basicUsers);
       return aa;
    }

    public Integer delete(Integer bid) {

        return basicDao.delete(bid);
    }

    public Integer insert(BasicUsers basicUsers) {

        return basicDao.insert(basicUsers);
    }
}
